Conditions | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import path from 'path'; |
||
4 | import { entry } from './constants'; |
||
5 | |||
6 | const execAsync = promisify(exec); |
||
7 | |||
8 | export function load(relPath, clearCache) { |
||
9 | const absPath = path.resolve(entry, relPath); |
||
10 | |||
11 | if (clearCache) delete require.cache[require.resolve(absPath)]; |
||
12 | // eslint-disable-next-line security/detect-non-literal-require |
||
13 | const result = require(absPath); |
||
14 | |||
15 | if (clearCache) delete require.cache[require.resolve(absPath)]; |
||
43 |